insignifColor = [ 1 222/255 33/255 ];

%% BESIP

attitudes = {
    'Duty to Vote'
    'Satisfact. w/ UK Dem.'
    'Trust MPs'
    'Internal Efficacy'
    'External Efficacy' };

corrs = abs([ ...
    0.195	0.000	0.000	-0.091	0.000
    0.014	0.341	-0.082	0.002	-0.051
    0.000	-0.034	0.133	0.021	-0.025
    -0.254	-0.070	0.018	0.450	0.010
    0.001	-0.098	-0.077	0.011	0.525]);

signif = [
    1	0	0	1	0
    1	1	1	1	1
    0	1	1	1	1
    1	1	1	1	1
    0	1	1	1	1];

usemap = sky;

f1 = figure;
imagesc(corrs); colorbar; colormap(usemap);
ax = gca;
set(ax,'XTick', 1:5 );
set(ax,'YTick', 1:5 );
set(ax,'XTickLabel',attitudes);
set(ax,'YTickLabel',attitudes);
print(gcf, 'heat_besip.eps', '-depsc');

f2 = figure;
tmp = corrs;
tmp(not(signif)) = max(corrs(:)) + 0.01;
mymap = usemap;
mymap(end, :) = insignifColor;
imagesc(tmp); colorbar; colormap(mymap);
ax = gca;
set(ax,'XTick', 1:5 );
set(ax,'YTick', 1:5 );
set(ax,'XTickLabel',attitudes);
set(ax,'YTickLabel',attitudes);
print(gcf, 'heat_besip_signif.eps', '-depsc');


%% GSS

attitudes = {
    'Ideological Id'
    'Military Spending'
    'Welfare'
    'Immigrants'
    'Party Id'
    'Environment'
    };

corrs = abs([ ...
    0.248206	-0.032988	-0.034986	0.040478	-0.149374	-0.103132
    -0.011999	0.503885	0.001500	0.019498	-0.087277	0.010500
    -0.010500	0.029991	0.542012	-0.023995	0.055443	-0.148396
    0.020997	0.009500	0.028492	0.534554	0.045469	-0.105110
    -0.231241	-0.079333	0.023496	0.023496	0.454613	-0.027493
    -0.129273	0.010500	-0.028492	-0.115482	0.006500	0.292685
    ]);

signif = [
    1	1	1	1	1	1
    0	1	0	0	1	0
    0	0	1	0	1	1
    0	0	1	1	1	1
    1	1	0	1	1	1
    1	0	0	1	0	1
    ];

usemap = sky;

f3 = figure;
imagesc(corrs); colorbar; colormap(usemap);
ax = gca;
set(ax,'XTick', 1:6 );
set(ax,'YTick', 1:6 );
set(ax,'XTickLabel',attitudes);
set(ax,'YTickLabel',attitudes);
print(gcf, 'heat_gss.eps', '-depsc');

f4 = figure;
tmp = corrs;
tmp(not(signif)) = max(corrs(:)) + 0.01;
mymap = usemap;
mymap(end, :) = insignifColor;
imagesc(tmp); colorbar; colormap(mymap);
ax = gca;
set(ax,'XTick', 1:6 );
set(ax,'YTick', 1:6 );
set(ax,'XTickLabel',attitudes);
set(ax,'YTickLabel',attitudes);
print(gcf, 'heat_gss_signif.eps', '-depsc');